
<!-- BEGIN PAGE CONTAINER-->
    <div class="container-fluid">
        <!-- BEGIN PAGE HEADER-->
        <div class="row-fluid">
            <div class="span12">
                <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                <h3 class="page-title">
                    Quản lý Tin tức
                </h3>
                <ul class="breadcrumb">
                    <li>
                        <i class="icon-home"></i>
                        <a href="/admin">Trang chủ</a>
                        <i class="icon-angle-right"></i>
                    </li>
                    <li>
                        <a href="<?php echo $this->createUrl('news/index'); ?>">Tin tức</a>
                        <i class="icon-angle-right"></i>
                    </li>
                    <li><a href="<?php echo $this->createUrl('category/index'); ?>">Danh mục tin tức</a></li>
                </ul>
                <!-- END PAGE TITLE & BREADCRUMB-->
            </div>
        </div>
        <!-- END PAGE HEADER-->
        <!-- BEGIN PAGE CONTENT-->
        <div class="row-fluid">
            <div class="span12">
                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                <div class="portlet box light-grey">
                    <div class="portlet-title">
                        <h4><i class="icon-bookmark-empty"></i>Danh mục tin tức</h4>
                        <div class="tools">
                            <a href="javascript:;" class="collapse"></a>
                        </div>
                    </div>
                    <div class="portlet-body">
                        <div class="clearfix">
                            <div class="btn-group">
                                <a href="<?php echo $this->createUrl('news/create');?>"><button id="sample_editable_1_new" class="btn green">
                                    Thêm mới <i class="icon-plus"></i>
                                </button></a>
                            </div>
                            <div class="btn-group pull-right">
                                <!--
                                <a href="#"><button class="btn red" type="button">
                                    Xóa <i class="icon-trash"></i>
                                </button></a>
                                -->
                            </div>
                        </div>
                        <div id="sample_1_wrapper" class="dataTables_wrapper form-inline" role="grid">
                        <form id="frm-news" action="/admin/news/saveorder" method="post">
                        <table class="table table-striped table-bordered table-hover dataTable">
                            <thead>
                            <tr role="row">
                                    <th class="sorting_disabled" style="width: 29px;">Stt</th>
                                    <th style="width: 24px;" class="sorting">
                                        <div class="checker" id="uniform-undefined"><span><input type="checkbox" class="group-checkable" style="opacity: 0;"></span></div>
                                    </th>
                                    <th class="sorting">Tiêu đề</th>
                                    <th class="sorting" style="width: 94px;">Ngày</th>
                                    <th width="120">Sắp xếp <a href="javascript:void(0);"><i class="icon-save"></i></a></th>
                                    <th class="sorting" style="width: 94px;"></th>
                                </tr>
                            </thead>

                            <tbody role="alert" aria-live="polite" aria-relevant="all">
                        <?php $i =0; foreach ($model as $key => $data) {  $i++; ?>
                            <tr class="gradeX odd">
                                <td class=" sorting_1"><?=$i?></td>
                                <td><div class="checker" id="uniform-undefined"><span><input type="checkbox" class="checkboxes" value="1" style="opacity: 0;"></span></div></td>
                                <td><a href="<?php echo $this->createUrl('news/update', array('id' => $data['id']));?>"><?php echo $data['title']?></a></td>
                                <td><?php echo date('m/d/Y', strtotime($data['updated'])) ?></td>
                                <td>
                                    <a class="btn grey mini" href="javascript:void(0)"><i class="icon-circle-arrow-down" rel="<?php echo $data['id']?>-<?php echo @$model[$key+1]['id']?>"></i></a>
                                    <a class="btn grey mini" href="javascript:void(0)"><i class="icon-circle-arrow-up" rel="<?php echo $data['id']?>-<?php echo @$model[$key-1]['id']?>"></i></a>
                                    <input style="width:30px" name="order[]" id="order<?php echo $data['id']?>" type="text" value="<?php echo $data['order']?>">
                                    <input name="id[]" type="hidden" value="<?php echo $data['id']?>">
                                </td>
                                <td>
                                    <a class="btn green mini" href="<?php echo $this->createUrl('news/update', array('id' => $data['id']));?>"><i class="icon-pencil icon-white"></i></a>
                                    <a class="delete btn red mini " href="<?php echo $this->createUrl('news/delete', array('id' => $data['id']));?>"><i class=" icon-remove icon-white"></i></a>
                                </td>
                            </tr>
                        <?php }?>
                        </tbody>
                        </table>
                        </form>
                            <?php if(count($model) > 0) {?>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <div class="dataTables_info" id="sample_1_info">Hiển thị <?php echo $pages->getCurrentPage()* $page_size +1;?> đến <?php echo ($item_count >= (($pages->getCurrentPage()+1) * $page_size))?($pages->getCurrentPage()+1) * $page_size : $item_count;?> của <?php echo $item_count?> kết quả</div>
                                    </div>
                                    <div class="span6">
                                        <div class="dataTables_paginate paging_bootstrap pagination">
                                            <?php
                                            // the pagination widget with some options to mess
                                            $this->widget('MyLinkPager', array(
                                                'currentPage' => $pages->getCurrentPage(),
                                                'itemCount' => $item_count,
                                                'pageSize' => $page_size,
                                                'maxButtonCount' => 5,
                                                'header' => '',
                                                'htmlOptions' => array('class' => 'pages'),
                                            ));
                                            ?>
                                        </div>
                                    </div>
                                </div>
                            <?php }?>
                        </div>
                    </div>
                </div>
                <!-- END EXAMPLE TABLE PORTLET-->
            </div>
        </div>

        <!-- END PAGE CONTENT-->
    </div>